﻿#region
/*******************************************************************************
** File Name:		    AdminUserRightRepository.cs
** Creator:		        chao.jiang 
** EMail:               chao.jiang 
** Create date:	        
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using Phoenix.Entity;
using Phoenix.Respository;
using IBatisNet.DataMapper;
using Phoenix.Data.IBatis;

namespace Phoenix.IBatisRepository
{
    public class AdminUserRightRepository : BaseIBatisDao,IAdminUserRight 
    {
    
		#region  Auto Generation

        public AdminUserRightRepository()
            : base("/Config/IBatis/86TCMap.Config")
        {

        }
        		
        public void AddAdminUserRight(EAdminUserRight entity)
        {
			string stmtId = "AdminUserRightMap.InsertAdminUserRight";
			base.SqlMapper.Insert(stmtId, entity);
        }
        
		public  EAdminUserRight GetByAdminUserRightID (System.Int32 adminUserRightID)
        {
			string stmtId = "AdminUserRightMap.SelectByAdminUserRightID";
			return base.SqlMapper.QueryForObject<EAdminUserRight>(stmtId, adminUserRightID);
        }
        
        public  void DeleteByAdminUserRightID (System.Int32 adminUserRightID)
        {
			string stmtId = "AdminUserRightMap.DeleteByAdminUserRightID";
			base.SqlMapper.Update(stmtId, adminUserRightID);
        }
        
        public  void UpdateByAdminUserRightID (EAdminUserRight entity)
        {
			string stmtId = "AdminUserRightMap.UpdateByAdminUserRightID";
			base.SqlMapper.Update(stmtId, entity);
        }


		#endregion

        public IList<EAdminUserRight> GetByUserID(int userID)
        {
            string stmtId = "AdminUserRightMap.SelectByUserID";
            return base.SqlMapper.QueryForList<EAdminUserRight>(stmtId, userID);
        }
    }
}

